/**
 * 消息二次弹框
 * @param { string }  title  提示标题
 * @param { string }  message  内容
 */

const useConfirm = (title: string = "警告", message: string = "内容") => {
  const showConfirm = async () => {
    try {
      await ElMessageBox.confirm(message, title, {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      });
      return true;
    } catch (err) {
      return false;
    }
  };
  return {
    showConfirm,
  };
};

export { useConfirm };
